package per.jdz.retryer.proxy;

import org.springframework.cglib.proxy.Enhancer;

public class ProxyFactory {

    public static Object createProxy(Object target, RetryerProxy retryerProxy) {
        Enhancer enhancer = new Enhancer();
        enhancer.setSuperclass(target.getClass());
        enhancer.setCallback(retryerProxy);
        return enhancer.create();
    }

}